﻿namespace CardGames
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class CardDeck
    {
        List<Card> _cardDeck = new List<Card>();

        //Constructor for Standard Deck of Cards
        public CardDeck(bool withJoker)
        {
            if (withJoker)
            {
                this._cardDeck.Add(new Card(Suits.Joker, CardValues.Wild));
                this._cardDeck.Add(new Card(Suits.Joker, CardValues.Wild));
            }

            for (int i = 1; i < 5; i++)
            {
                for (int j = 1; j < 14; j++)
                {
                    this._cardDeck.Add(new Card((Suits)i, (CardValues)j));
                }
            }
        }

        public CardDeck(IEnumerable<Card> initialCards)
        {
            this._cardDeck.AddRange(initialCards);
        }

        public List<Card> Get { get { return this._cardDeck; } }

        public void Shuffle()
        {
            this._cardDeck = this._cardDeck.OrderBy(x => Guid.NewGuid()).ToList();
        }
    }
}
